<!--导航到用户中心的路由-->
<script lang="ts" setup>
import {UserRoute} from "../../router";

interface Props {
  userId?: number | undefined;
  username?: string | undefined;
}

const props = defineProps<Props>();
</script>

<template>
  <span v-if="!userId && !username">缺少参数</span>
  <span v-else-if="username==='#ANONYMOUS#'">匿名用户</span>
  <span v-else-if="username==='#SYSTEM#'">系统账号</span>
  <router-link v-else :to="{
    name:userId ? UserRoute.USER_CENTER_ID : UserRoute.USER_CENTER_USERNAME ,
    params: userId?{userId}:{username}
  }" class="clickable clean-a">
    <b>
      <slot/>
    </b>
  </router-link>
</template>

<style scoped>

</style>